package testDrivenDeveloppement;

import static org.junit.Assert.*;
import modele.Bot;
import modele.BotUrbain;
import modele.Case;
import modele.EtatBot;
import modele.Feu;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

public class BotTest {

	private Bot bot;
	private Feu feu;
	private Case caseFeu, caseBot;
	
	@Before
	public void setUp() throws Exception {
		
		this.caseFeu = new Case(15, 15, false);
		this.caseBot = new Case(4, 12, false);
		
		this.bot = new BotUrbain(10, "Stendhal", EtatBot.ARRET);
		this.bot.setCaseCourante(this.caseBot);
		
		this.feu = new Feu();
		this.feu.setCaseCourante(this.caseFeu);
	}

	@After
	public void tearDown() throws Exception {
		this.bot = null;
		this.feu = null;
		this.caseBot = null;
		this.caseFeu = null;
	}

	@Test
	public void testCalculerFeu() {
		this.bot.getCalculFeu(this.feu);
		int[] coordonnee = {-11, -3};
		assertEquals(14, this.bot.getDistance());
		assertEquals(coordonnee[0], this.bot.getDistanceAParcourir()[0]);
		assertEquals(coordonnee[1], this.bot.getDistanceAParcourir()[1]);
	}

}
